FSpCreate
FSpCreate Create a new file and set the type and creator
#include <Files.h> File Manager
OSErr FSpCreate(spec , creator, fileType , scriptTag);
FSSpec *spec; a pointer to an FSSpec record
OSType creator; identifies the file creator
OSType fileType ; identifies the file type
ScriptCode scriptTag ; identifies the script system code
returns Error Code; 0=no error
FSpCreate creates a new file and sets the type and creator. It is the
high-level, FSSpec version of the PBHCreate function.
spec is a ponter to an FSSpec record specifying the file to be created
creator is used to set the new file creator
fileType is used to set the new file type
scriptTag specifies the code of the script system in which the document name
is to be displayed. If StandardPutFile was used to get the file, the
sfScript field of the StandardFileReply structure should be passed in
this parameter.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
bdNamErr (-37) Bad name
dirFulErr (-33) Directory full
dirNFErr (-120) Directory not found
dupFNErr (-48) Duplicate filename already exists
extFSErr (-58) External file system
ioErr (-36) I/O error
nsvErr (-35) No such volume
vLckdErr (-46) Volume is locked
wPrErr (-44) Diskette is write-protected

Notes: If you have established the name and location of the new file through either
the StandardPutFile or CustomPutFile procedure, specify the script
code returned in the reply record. Otherwise, specify the system script by
setting the scriptTag parameter to smSystemScript. For more information
on script systems, see the Worldwide Software Overview